ds_map_write


描述

This function will turn the ds_map data of the specified map into string format which can then be written to an *.ini or a *.txt file for easy storage. This string can then be later read back into a new ds_map using ds_map_read().

NOTE: The returned string is not a human readable string, but rather a dump of the contents of the data-structure.


语法:

ds_map_write(id);

参数 描述
id The id of the data structure to use


返回:

String(字符串)


例如:

ini_open("map.ini");
var t_string;
t_string = ds_map_write(inventory);
ini_write_string("Saved", "0", t_string);
ini_close();

The above code opens an ini file ready to be written to. It then uses ds_map_write() to generate a string which is stored in the temporary variable "t_string". Finally, it writes that string to the ini file before closing it.